<template>
  <div class="home-container">
    <div class="header">
      <div class="title-wrapper">
        <h1>AI 应用中心</h1>
        <div class="subtitle">
          <span class="typing-text">探索智能助手带来的无限可能</span>
          <span class="cursor">|</span>
        </div>
      </div>
    </div>
    <div class="app-grid">
      <el-card class="app-card" @click="navigateTo('/trip')">
        <div class="card-content">
          <div class="icon-wrapper trip-icon">
            <i class="el-icon-location"></i>
          </div>
          <h2>AI 旅游规划</h2>
          <p>智能规划您的完美旅程</p>
          <div class="card-footer">
            <span class="tech-tag">AI</span>
            <span class="tech-tag">旅行</span>
            <span class="tech-tag">规划</span>
          </div>
        </div>
      </el-card>
      <el-card class="app-card" @click="navigateTo('/manus')">
        <div class="card-content">
          <div class="icon-wrapper manus-icon">
            <i class="el-icon-s-custom"></i>
          </div>
          <h2>AI 超级智能体</h2>
          <p>您的智能助手</p>
          <div class="card-footer">
            <span class="tech-tag">AI</span>
            <span class="tech-tag">智能体</span>
            <span class="tech-tag">助手</span>
          </div>
        </div>
      </el-card>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'

const router = useRouter()

const navigateTo = (path) => {
  router.push(path)
}
</script>

<style scoped>
.home-container {
  min-height: 100vh;
  padding: 2rem 1rem;
  background-color: var(--bg-color);
  position: relative;
  overflow: hidden;
}

.header {
  text-align: center;
  margin-bottom: 4rem;
  position: relative;
}

.title-wrapper {
  position: relative;
  display: inline-block;
}

h1 {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: var(--neon-glow);
  position: relative;
}

.subtitle {
  color: var(--text-light);
  font-size: 1.2rem;
  position: relative;
  display: inline-block;
}

.typing-text {
  border-right: 2px solid var(--primary-color);
  animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

.cursor {
  color: var(--primary-color);
  animation: blink 1s infinite;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

.app-card {
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background-color: var(--card-bg);
  overflow: hidden;
  position: relative;
}

.app-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.app-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
  animation: glow 2s infinite;
}

.app-card:hover::before {
  opacity: 1;
}

.card-content {
  padding: 2rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.icon-wrapper {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  box-shadow:
    0 0 16px 4px #00ff9d88,
    0 0 32px 8px #00b8ff44,
    0 0 0 4px rgba(0,255,157,0.15) inset;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: box-shadow 0.3s;
}

.trip-icon {
  background: radial-gradient(circle at 60% 40%, #00ff9d 60%, #00b8ff 100%);
}

.manus-icon {
  background: radial-gradient(circle at 60% 40%, #a259ff 60%, #00b8ff 100%);
  box-shadow:
    0 0 16px 4px #a259ff88,
    0 0 32px 8px #00b8ff44,
    0 0 0 4px rgba(162,89,255,0.15) inset;
}

.icon-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 24px 8px #00ff9d55, 0 0 48px 16px #00b8ff33;
  pointer-events: none;
  z-index: 0;
}

.manus-icon::after {
  box-shadow: 0 0 24px 8px #a259ff55, 0 0 48px 16px #00b8ff33;
}

.icon-wrapper i {
  font-size: 36px;
  color: #fff;
  filter: drop-shadow(0 0 6px #00ff9d) drop-shadow(0 0 2px #00b8ff);
  z-index: 1;
}

.manus-icon i {
  filter: drop-shadow(0 0 6px #a259ff) drop-shadow(0 0 2px #00b8ff);
}

h2 {
  margin: 0;
  color: var(--text-color);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

p {
  margin: 0;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.card-footer {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.tech-tag {
  background: var(--primary-light);
  color: var(--primary-color);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  border: 1px solid var(--primary-color);
}

@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: var(--primary-color) }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@media (max-width: 768px) {
  .home-container {
    padding: 1rem;
  }

  h1 {
    font-size: 2rem;
  }

  .app-grid {
    gap: 1rem;
  }

  .card-content {
    padding: 1.5rem;
  }

  .icon-wrapper {
    width: 60px;
    height: 60px;
  }

  .icon-wrapper i {
    font-size: 28px;
  }
}
</style> 